package strategy.a;

public class CashContext {

	private CashSuper strategy;

	public CashContext(String strategyType) {
		if ("正常收费".equals(strategyType)) {
			strategy = new CashNormal();
		} else if ("打八折".equals(strategyType)) {
			strategy = new CashRebate(0.8);
		} else if ("满300减30".equals(strategyType)) {
			strategy = new CashReturn(300, 30);
		} else if ("满500减50".equals(strategyType)) {
			strategy = new CashReturn(500, 50);
		} else {
			strategy = new CashNormal();
		}
	}
	
	public double getResult(double cash) {
		return strategy.acceptCash(cash);
	}
	
}
